\frame[containsverbatim]
{
  \frametitle{LockCountAnalysis implementation (continued)}
  Instruction transfer function:
{\scriptsize
\begin{verbatim}
  @Override
  public void transferInstruction(InstructionHandle handle,
          BasicBlock basicBlock, LockCount fact)
          throws DataflowAnalysisException {
    if (!isFactValid(fact)) {
      return;
    }
    
    short opcode = handle.getInstruction().getOpcode();
    if (opcode == Constants.MONITORENTER) {
      fact.setCount(fact.getCount() + 1);
    } else if (opcode == Constants.MONITOREXIT) {
      fact.setCount(fact.getCount() - 1);
    }
    
    if (fact.getCount() < 0) {
      fact.setCount(LockCount.BOTTOM);
    }
  }
\end{verbatim}
}
}
